package com.zjt.controller;

import com.zjt.bean.BaseRespVo;
import com.zjt.bean.data.UserData;
import com.zjt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * @param page  页码
     * @param limit 数据量
     * @param sort  排序列名
     * @param order 顺序
     * @return
     */
    /*@RequestMapping("list")
    public BaseRespVo list(Integer page, Integer limit, String sort, String order) {
        UserData userData =  userService.selectUserData(page,limit,sort,order);
        return BaseRespVo.ok(userData);
    }*/
    @RequestMapping("list")
    public BaseRespVo list2(String username, String mobile, Integer page, Integer limit, String sort, String order) {
        UserData userData = userService.selectUserData(page, limit, sort, order,username,mobile);
        return BaseRespVo.ok(userData);
    }
}
